|
f :: A -> B, x :: A --------------------- (App) f x :: B This rule, called "App" for application, says that if expression f has type A -> B and expression x has type A then we can deduce that expression (f x) has type B. The expressions above the line are the premises and below, the conclusion. An alternative notation often used is: G |- x : A where "|-" is the turnstile symbol (LaTeX vdash) and G is a type assignment for the free variables of expression x. The above can be read "under assumptions G, expression x has type A". (As in Haskell, we use a double "::" for type declarations and a single ":" for the infix> list constructor, cons). Given an expression plus (head l) 1 we can label each subexpression with a type, using type variables X, Y, etc Given an expression plus (head l) 1 we can label each subexpression with a type, using type variables X, Y, etc スポンサード リンク
|